﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using StarsAdmin.Core.DB.Entities;

namespace StarsAdmin.Core.DB.Configs
{
    public class RegionConfig : IEntityTypeConfiguration<RegionEntity>
    {
        public void Configure(EntityTypeBuilder<RegionEntity> builder)
        {
            builder.ToTable("T_Regions");
            builder.Property(p => p.Code).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Name).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Type).IsRequired();
            builder.Property(p => p.Description).IsRequired(false).HasMaxLength(256);
        }
    }
}